Send digital receipts
This interface separately provides the feature of sending the receipt to customer. To resend is allowed, but the content can't be modified when resending.
API URL
UAT : https://uat.test2pay.com/sgs/api/digitalReceipt/notify
Production : https://api.payby.com/sgs/api/digitalReceipt/notify
Request
Http Header
Attributes
Content-Language String
The language in which the response message will be used, currently only English is supported.
Example value: en
Maximum length: 10
Content-Type String Required
The media type. Required for operations with a request body. The value is application/<format>
, where format
is json
.
Example value: application/json
sign String Required
Requests should be signed using private-key cryptography. This allows the payment gateway to verify that an incoming request is really from your application.
Partner-Id String Required
The merchant id of your account.
Example value: 200001200101
Maximum length: 12
Http Body
requestTime Timestamp Required
If the request time is more than 15 minutes away from the current time, the request will be rejected. This parameter is used to prevent repeated requests for orders that should have been cancelled due to timeouts.
Example value: 1581493898000
bizContent Object
You can use either receiptNo
or orderNo
to specify an order. But you can't use the two parameters at the same time.
receiptNo String Required
The merchant's referece number of the receipt.
Example value: M965739182419
Maximum length:
64
orderNo String Required
The PayBy's unique identify number of the order.
Example value: 131658300517875854
Maximum length:
32
Request sample
Http Header
{
"Content-Language": "en",
"Content-Type": "application/json",
"sign": "CCk1rcB+2kuF9PqLjukLQ3thcHIHeovlKN+q7HYn59aKaqHbsEjGCMg/e3h1dLbeMDO62liKS7mCB4O+l1dKdxXMzjG1sKgQ+UGmK/wD7QqF+W7iBio6ynYe4bscSc6sN66pNWh+4LIZ39mpPvQSXFTpeWVrPUyAwizskbreugxWkCWXYvmffGdZI/j4u4gFIht8VPWJJgL14c5wbGzPK0lTQsLBMajVghKIx4v3AfRHzvYYrxGqD8z6DRQcfnc5FOh4k9C5jo5d0x7gdFKNz8qZGHM3JI/EWJ4u2GVgWSEHCIsMbj0UQj2SCl/pB9BfCiWZIy1Jlo+dyqLpHRPceg==",
"Partner-Id": "200000000888"
}
Http Body
{
"requestTime": 1581405884647,
"bizContent": {
"receiptNo": "534298"
}
}
Response
Http Header
sign String Required
When PayBy sends response, PayBy will use its own private key to sign the message, and the merchant uses PayBy 's public key to verify the signature. If the verification is passed, it proves that the response was sent by PayBy and not faked by others.
body
Notice : Body is returned only when applystatus
= success
, and code
= 0
.
If applystatus
= error
or failed
; or applystatus
= success
, code
!=0
, that indicates an error. Please check errors and try again.
receiptOrder Object
The attributes are:
receiverEmail String
The customer's email to receive digital receipt.
Example value: customer@email.com
Maximum length:
200
memberId String
The customer's PayBy member ID. The customer will receive a message with receipt information in the PayBy app.
Example value: 10000000011
Maximum length:
12
receiverMobileNumber String
The customer's mobile number to identify his or her member id in PayBy. The customer will receive a message with receipt information in the PayBy app.
Example value: +971-585800000
Maximum length:
32
orderNo String
The customer's PayBy member ID. The customer will receive a message with receipt information in the PayBy app.
Example value: 10000000011
Maximum length:
12
partnerMid String
The customer's PayBy member ID. The customer will receive a message with receipt information in the PayBy app.
Example value: 10000000011
Maximum length:
12
receipt Object
The content of receipt, the attributes are:
type String Required
If you pass
Y
, the receipt will showTax Invoice
on it. If you passN
, the receipt will not showTax Invoice
on it.Example value: Y
name String
The store name.
Maximum length:
200
address String
The store address.
Maximum length:
200
tel String
The store contact number.
Maximum length:
200
email String
The store contact number.
Maximum length:
200
trn String
The merchant's Tax Registration Number.
Example value: 100285640700001
Maximum length:
15
receiptNo String Required
The number of this receipt in the merchant's system. Note that the number should be unique, and for different receipts the same receipt number cannot be passed.
Maximum length:
200
date Timestamp Required
The date and the time the receipt generated.
Example value: 1581493898000
goodsList List
The attibutes of each item are:
id String
The item's id.
Example value: New Apple iPhone 13 Pro (128GB) - Sierra Blue
Maximum length:
200
.name1 String Required
The item's name or description.
Maximum length:
200
.name2 String
You may pass the item's name in another language.
Maximum length:
200
.quantity String
The quantity of this item the customer purchased.
Maximum length:
200
.amount Money Required
The unit price of this item.
Maximum length:
200
.
count Integer
Total quantity of all items.
Maximum value:
100,000
.totalBeforeVat Money Required
The payable amount before tax.
vatAmount Money Required
The tax amount.
vatRate Decimal Required
The tax rate. For the rate of 5%, pleasse pass
5
.Minimum value:
0
Maximum value:
100
totalAmount Money Required
The payable amount after tax.
store String
The addtional information of the store.
Maximum length:
200
counter String
On which counter the payment was made.
Maximum length:
200
pos String
On which POS machine the payment was made.
Maximum length:
200
cashier String
Which cashier collected the money when the payment was made. Pass the id or name of the cashier.
Maximum length:
200
paymentChannel String
The payment method the customer used when the payment was made.
Maximum length:
200
paymentId List
The order number or payment order number.
Maximum length of each payment id:
32
payAmount Money
The amount paid by the customer.
changeAmount Money
Change amount given by cashier to customer.
refundNo String
If the transaction needs to be refunded, this number can be used to identify the original transaction.
Maximum length:
200
notes String
Merchant's notes for the transaction.
Maximum length:
200
Response sample
Http Header
{
"sign": "TmdNrIM01QRX4KTU7CQFgrO3+e3Xcqq3MmITZgQuQzdcM9b5X71sCUZq7Hkm42gzqnBzy84k/xuSkMT2FVAQ2qbjSbx1U/3WOeRl2KddOW3NSz/XhO+dH3EHFoRN7/sS6uG6fqV/SVnQAkPqMCbpr6Hw74wac6O0slcbYwZd69mbSlE5EmNCmqyHgQfh7slwqd7K+FNXk9CX+FYx9FN3WpR7eZUpVQt4636CfNMPDnDQfNGC1fimoAD8MZZKeCK1Ssn6MM2FLh+ADAfPrwey2Ab/3QlsE8iz643mB8WIfqDpACbUDdsZ79D8F8b6nducWU7BAw/E6VrEdvwNlkaSAg=="
}
Http Body
{
"body":{
"receiptOrder":{
"memberId":"100000329946",
"orderNo":"911631930376004613",
"partnerMid":"200000030907",
"receipt":{
"address":"TCA,Abu Dhabi",
"cashier":"Sajjad Ajij",
"changeAmount":{
"amount":0,
"currency":"AED"
},
"count":2,
"counter":"6",
"date":1631930376223,
"email":"cutomercareauh@ae.lulumea.com",
"goodsList":[
{
"amount":{
"amount":13.2,
"currency":"AED"
},
"id":"9947345013207",
"name1":"Norwegian Salmon Steak",
"name2":"ستيك السلمون النرويجي",
"quantity":1
},
{
"amount":{
"amount":2,
"currency":"AED"
},
"id":"99473450132018",
"name1":"Coca cola 350ml",
"name2":"كوكا كولا 350 مل",
"quantity":5
}
],
"name":"LuLu Express Fresd Market",
"notes":"Keep bill for exchange within 7 days.Valid only at issued store.*T&C Apply.Thanks you for shopping. Shop online at www.luluhypermarket.com",
"payAmount":{
"amount":23.2,
"currency":"AED"
},
"paymentChannel":"CASH",
"pos":"2",
"receiptNo":"534298",
"refundNo":"662142002053429820210730153140",
"store":"2142",
"tel":"02 3090550",
"totalAmount":{
"amount":22.3,
"currency":"AED"
},
"totalBeforeVat":{
"amount":22.3,
"currency":"AED"
},
"trn":"100228723100003",
"type":"Y",
"vatAmount":{
"amount":1.1,
"currency":"AED"
},
"vatRate":5
},
"receiverEmail":"testdemo@payby.com",
"receiverMobileNumber":"+971-585660747"
}
},
"head":{
"applyStatus":"SUCCESS",
"code":"0",
"msg":"SUCCESS",
"success":true,
"traceCode":"952135"
}
}